package com.mijie.homi.test;

import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IoSession;

import com.mijie.homi.common.protocol.HomiProtocol;

public class ClientHandler extends IoHandlerAdapter {

	
	@Override
	public void messageReceived(IoSession session, Object message)
			throws Exception {
		HomiProtocol protocol = (HomiProtocol) message;
		System.out.println("[client messageReceived] type:"+protocol.getType()+",content:"+protocol.getContent());
	}
	
	@Override
	public void messageSent(IoSession session, Object message) throws Exception {
		HomiProtocol protocol = (HomiProtocol) message;
	}

	@Override
	public void exceptionCaught(IoSession session, Throwable cause)
			throws Exception {
		cause.printStackTrace();
	}
	
	
}
